/* Copyright (C) 2010 Fredrique Samuels, fredriquesamuels@gmail.com */

/*
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef TRI_EXT_TAB_PANEL_H_
#define TRI_EXT_TAB_PANEL_H_

#include <iostream>
#include <vector>
#include <string>
#include <map>

//Include library header
#include "checkbox.h"
#include "panel.h"


namespace tri {
namespace ui {


class extTabButton : public extCheckBox{
public:
	extTabButton();
	virtual ~extTabButton();
};

class extTabButtonPanel : public tri::ui::extPanel {
public:
	extTabButtonPanel();
	virtual ~extTabButtonPanel();
	
	void addTabButton(std::string tabName,std::string text = "");
	extTabButton* removeButton(std::string tabButton);
	void getButtonList(std::vector<std::string>& buttonNames);
	bool containsTab(std::string tab);
	extTabButton* getSelected();
	void setActive(int index);
	
	virtual void update();
	virtual void setStyle(std::string name);
	
private:
	std::map<std::string,extTabButton*> mButtonMap;
	std::string mButtonStyles;
	tri::ui::extButtonGroup mButtonGroup;
};

class extTabPanel : public extPanel{
public:
	extTabPanel();
	virtual ~extTabPanel();
	
	void addTab(std::string title,extPanel* panel);
	virtual void update(); 
	virtual void setStyle(std::string name);
	bool containsTab(std::string tab);
	
protected:
	void updateActivePanel();
	
	std::map<std::string,extPanel*> mPanelMap;
	extTabButtonPanel mButtonPanel;
};

}
}

#endif
